Skip to content

Add docusaurus-plugin-copy-page-button#4682

Merged
nfs0619 merged 3 commits into
Seeed-Studio:docusaurus-versionfrom
portdeveloper:add-copy-page-button
May 27, 2026
Merged

Add docusaurus-plugin-copy-page-button#4682
nfs0619 merged 3 commits into
Seeed-Studio:docusaurus-versionfrom
portdeveloper:add-copy-page-button

Conversation

@portdeveloper
Copy link
Copy Markdown
Contributor

Summary

Adds docusaurus-plugin-copy-page-button across all five language sites so readers can copy any wiki page as clean markdown — useful when piping hardware setup or firmware troubleshooting context into ChatGPT, Claude, Perplexity, or Gemini.

The plugin auto-injects a small "Copy page" button + dropdown into the doc page's table-of-contents area. The dropdown offers:

  • Copy as markdown
  • View as markdown
  • Open in ChatGPT / Claude / Perplexity / Gemini

Live preview of the UI: https://portdeveloper.github.io/copy-page-button-showcase/

Adoption

The plugin currently ships on the docs sites for React Native (just merged via facebook/react-native-website#5085), Puppeteer, Arbitrum, Cardano, Sui, Ethereum execution-apis, and several others — full list in the project README.

Changes

  • Added 'docusaurus-plugin-copy-page-button' to the plugins array in each language config (sites/en, sites/zh-CN, sites/ja, sites/es, sites/pt-BR)
  • Added docusaurus-plugin-copy-page-button@^0.6.2 to root dependencies
  • Resulting yarn.lock updates

yarn build of the English site passes locally; the other four configs use the identical plugin entry.

@github-actions
Copy link
Copy Markdown
Contributor

👍 @portdeveloper

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.

@nfs0619
Copy link
Copy Markdown
Collaborator

nfs0619 commented May 26, 2026

Thanks for sharing this! Is there a way to customize the button text, so we can use localized labels for different language sites?

@portdeveloper
Copy link
Copy Markdown
Contributor Author

Great question @nfs0619 — just shipped v0.7.0 and bumped this PR's version constraint so you can do exactly that.

The plugin now accepts a labels option per-config, which is the right fit for this repo since each language has its own Docusaurus site with its own defaultLocale. Drop a labels block into each sites/<lang>/docusaurus.config.js:

// sites/zh-CN/docusaurus.config.js
plugins: [
  // ...
  [
    'docusaurus-plugin-copy-page-button',
    {
      labels: {
        button: { label: '复制页面' },
        copy:   { title: '复制页面', description: '将本页内容复制为 Markdown' },
        view:   { title: '以 Markdown 查看' },
        chatgpt:    { title: '在 ChatGPT 中打开' },
        claude:     { title: '在 Claude 中打开' },
        perplexity: { title: '在 Perplexity 中打开' },
        gemini:     { title: '在 Gemini 中打开' },
      },
    },
  ],
],

You only need to override the strings you want translated — anything missing falls back to the English default. Same shape for ja/, es/, pt-BR/. Full ID list (titles + descriptions) and a matching i18n path for standard multi-locale sites is documented here in the README.

I left the configs in this PR with no labels (default English) — happy to push another commit wiring up your preferred translations for any subset of languages if it'd help land this. Or feel free to take it from here.

@nfs0619
Copy link
Copy Markdown
Collaborator

nfs0619 commented May 27, 2026

Thanks for the quick update, and thanks for contributing this plugin. The new labels option should cover what we need for localization.

I’ll take care of the localized config on our side before merging.

@portdeveloper
Copy link
Copy Markdown
Contributor Author

You're welcome! Let me know if you think any other updates could be helpful for your docs

@nfs0619
Copy link
Copy Markdown
Collaborator

nfs0619 commented May 27, 2026

Thanks again for the quick update and for contributing this plugin!

I’ve now added the localized labels on our side, and everything looks good. I’ll merge this PR now.

@nfs0619 nfs0619 merged commit f45e909 into Seeed-Studio:docusaurus-version May 27, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

❤️ Great PR @portdeveloper ❤️

portdeveloper added a commit to portdeveloper/docusaurus-plugin-copy-page-button that referenced this pull request May 27, 2026
portdeveloper added a commit to portdeveloper/copy-page-button-showcase that referenced this pull request May 27, 2026
- Add Seeed Studio Wiki to adopters (Seeed-Studio/wiki-documents#4682 merged)
- Remove Lexical from review list — owner chose server-side implementation,
  not a rejection of the plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants